﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace DtCms.Web
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Response.Write("第一次执行");
            
            }

            Response.Write("回发");

            if (txttitle.Text.Trim() != "")
            {
                rp_list.DataSource = createdt("cc");
                rp_list.DataBind();
            }

            if (txtproduct.Text.Trim()!= "")
            {
               rp_product .DataSource = createdt("dd");
               rp_product.DataBind();
            }
        }



        public DataTable createdt( string s)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title",typeof(string));
            for (int i = 0; i < 10; i++)
            {
                DataRow dr = dt.NewRow();
                dr["title"] = s + "i";
                dt.Rows.Add(dr);
            }


            return dt;
        }

        protected void btnadd_Click(object sender, EventArgs e)
        {
            Response.Write("cc");
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            Response.Write(rp_list.Items.Count.ToString());

            Response.Write(rp_product.Items.Count.ToString());
        }
    }
}
